<?php
require_once 'recordset.CMS.class.php';

/**
 * Created by Mauro Gadaleta
 * User: Mauro
 * Date: 12/04/11
 * Time: 12:20
 *
 * Clase Base para los Gadgets del CMS (extiende de Smarty)
 */
class gadgetsCMS extends Smarty {

    /**
     * construtor set up
     */
	function __construct() {
		$this->configSmarty();
	}

    /**
     * Configuración de Smarty
     * @return void
     */
	private function configSmarty() {
		$this->template_dir = 'CMS/templates';
        $this->compile_dir  = 'CMS/templates_c';
        $this->config_dir   = 'CMS/configs';
        $this->cache_dir    = 'CMS/cache';
	}

    /**
     * Devuelve el codigo html del gadget sin compilar
     * @param  $template
     * @return string
     */
	protected function getContent($template) { return $this->fetch($template); }

    /**
     * Devuelve el codigo HTML compilado del gadget
     * @return string
     */
	function get() { return $this->getContent($this->template); }
}

?>